/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cs575.coresystem;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 *
 * @author bms
 */
public class Accounting {
    private static FileWriter logStream = null;       
    public static void initLog()
    {
        try {
            logStream = new FileWriter("../../../../log/logFile.log", true);
        } catch (IOException iOException) {
        }
    }
    public Accounting()
    {  
    }
    
    public static void info(String label,String message)
    {
       write("INFO",label.toUpperCase()+":"+message);
    }
    
    public static void warning(String label,String message)
    {
        write("WARNING",label.toUpperCase()+":"+message);
    }

    private static void write(String type,String message) {
        Date date = null;
        try {
            date = new Date();
//            logStream.write(type+"|"+Utils.dateFormat(date) +"|"+message);
              System.out.println(type+"|"+Utils.dateFormat(date) +"|"+message);
        } catch (Exception e) {
        }
    }
}
